package com.aihome.springbootaoplog.controller;

import com.aihome.springbootaoplog.annotation.LogOut;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhangjigang
 * @description
 * @className LogTestController
 * @date 2021/6/11 13:38
 * @vision 1.0.0
 */
@RestController
@Slf4j
@RequestMapping("/log")
public class LogTestController {

    @GetMapping("/test")
    @LogOut(description = "测试日志")
    public void test() {

    }

    @GetMapping("/test2")
    @LogOut(description = "测试日志")
    public String test2(String params) {

        return "jieguo";
    }

    @GetMapping("/test3")
    public String test3(String params) {

        return "jieguo";
    }

    @GetMapping("/test4")
    @LogOut(description = "测试日志")
    public String test4(String params) {
        String a = params;
        System.out.println(a + "错误");
        throw new RuntimeException("测试问题日志");
    }
}
